package com.tanxi521.springboot.service.impl;

import com.tanxi521.springboot.mapper.LimitItemMapper;
import com.tanxi521.springboot.pojo.LimitItem;
import com.tanxi521.springboot.pojo.Page;
import com.tanxi521.springboot.service.LimitItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: i-xiaotian
 * @Date: 2022/4/9 23:03
 * @EMAIL: 1254806967@qq.com
 */
@Service
public class LimitItemServiceImpl implements LimitItemService {

    @Autowired
    LimitItemMapper limitItemMapper;

    @Override
    public List<LimitItem> queryLimitItemList(Integer pageSize, Integer pageIndex) {
        Page page = new Page(pageIndex, pageSize);
        return limitItemMapper.selectLimitItemList(page);
    }

    @Override
    public int queryLimitItemCount() {
        return limitItemMapper.selectLimitItemCount();
    }

    @Override
    public int insertLimitItem(LimitItem limitItem) {
        return limitItemMapper.insert(limitItem);
    }

    @Override
    public int deleteLimitItem(List<Integer> ids) {
        return limitItemMapper.deleteLimitItemList(ids);
    }
}
